using DaprPlus.Settings;
using DaprPlus.Settings.Domain.Entities;


namespace Todos.Infrastructure.EntityFrameworkCore.Configurations;

public class SettingItemConfiguration : EntityConfigurationBase<SettingItem>
{
    /// <summary>
    /// 重写以实现实体类型各个属性的数据库配置
    /// </summary>
    /// <param name="builder">实体类型创建器</param>
    public override void Configure(EntityTypeBuilder<SettingItem> builder)
    {
        builder.Property(m => m.Key).IsRequired().HasMaxLength(2000);
        builder.Property(m => m.ValueJson).HasMaxLength(-1);
        builder.Property(m => m.ValueTypeName).HasMaxLength(500);
        builder.Property(m => m.Display).HasMaxLength(100);
        builder.Property(m => m.Remark).HasMaxLength(500);
    }
}
